<?=view('home.common.header')?>
<?=view('home.common.nav')?>
<style>
    input.form-control, a.form-control, select.form-control, textarea.form-control {
        margin-top: 15px;
    }
</style>
<div class="container">
    <div class="container-fluid">
        <div class="row">
            <div class="col-xs-12 col-md-12" style="padding-top: 10px;">
                <a href="<?=url("home/person/pushmoney")?>" class="button button-circle button-small button-highlight"><i class="fa fa-reply"></i></a>
            </div>
            <div class="col-xs-12 col-md-12">
                <input type="number" id="applymoney" class="input input-lg form-control" name="name" max="<?=$total?>" required="required" placeholder="请输入要提现金额"/>
                <a href="<?=url('home/person/apply')?>" class="button button-action form-control eveModify">提交申请</a>
            </div>
        </div>
    </div>
</div>
<script>
    $('.eveModify').click(function() {
            var tt = <?=$total?>,
                url = $(this).attr('href');
                if (parseInt($('#applymoney').val()) > parseInt(tt) || $('#applymoney').val() == '') {
                   layer.open({
                        content: '最大提现金额为:'+tt,
                        style: 'background-color:#3E403E; color:#fff; border:none;',
                        time: 2
                   });
                   return false;
                }
            $.get(url, {pushmoney: $('#applymoney').val()}, function(data) {
               layer.open({
                   content: data.info,
                   style: 'background-color:#3E403E; color:#fff; border:none;',
                   time: 2
               });
               window.setTimeout(function(){window.location.href='<?=url("home/person/pushmoney")?>'},2000);
           });
        return false;
    });
</script>
<?=view('home.common.header')?>
